<!--# layout("/common/layout.html",{"jsBase":"/js/cms/renting/"}){ -->

<form class="layui-form " id="updateForm">
    <!--# include("/cms/common/basic.html",{"basic":renting}){} -->
    <!--# include("commonedit.html"){} -->
    <layui:personnelsubmitButtons id="updateButton" />
</form>
<!--#} -->
<script>

    //页面加载完成 根据下拉框内容排序 在重新渲染下拉框
    $(document).ready(function(){
        sortOption("declarationGrade");
       // form.render('select', 'declareYear');
    });


    $(document).on('click','#endDate1',function() {
        $("#endDate").val("2099-12-31")
    });
layui.use(['edit'], function(){
    var rentingEdit = layui.edit;
    rentingEdit.init();

    var form = layui.form;
    form.on('select(declareYear)', function (data) {
        var grade=data.elem[data.elem.selectedIndex].text;
        var month =$("#numberDeclarations").val();
        $("#totalAmount").val(grade*month);
    });

    var form = layui.form;
    form.on('select(declareYear1)', function () {
        var grade=$("#declarationGrade").find("option:selected").text();
        var month =$("#numberDeclarations").val();
        $("#totalAmount").val(grade*month);
    });

});

function addRelatives(id) {
    var url = "/cms/renting/addRelatives.do?id="+id;
    Common.openDlg(url);
};

function updateRelatives(id) {
    var url = "/cms/renting/editRelatives.do?id="+id;
   Common.openDlg(url);
};

function deleteRelatives(id) {
    var rentingApi = layui.rentingApi;
    rentingApi.deleteRelatives(id,function(){
        Common.info("删除成功");
        dataReload();
    })
};
</script>
